#include "CountingSemaphore.h"
#include <stdio.h>

CountingSemaphore::CountingSemaphore(unsigned int initCount) 
{
	// returns 0 on succes
	int r = sem_init(&_semid, 1, initCount);
}

CountingSemaphore::~CountingSemaphore()
{
	
}

int CountingSemaphore::wait()
{
	int r = sem_wait(&_semid);
	return r;
}

int CountingSemaphore::signal()
{
	int r = sem_post(&_semid);
	return r;
}
